package cn.dujc.superkid.fragment.MyLessonVideo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;

import java.util.ArrayList;
import java.util.List;

import cn.dujc.core.adapter.BaseQuickAdapter;
import cn.dujc.core.ui.BaseFragment;
import cn.dujc.core.ui.BaseListActivity;
import cn.dujc.core.ui.BaseListFragment;
import cn.dujc.core.util.ToastUtil;
import cn.dujc.superkid.R;
import cn.dujc.superkid.adapter.MessageEntityAdapter;
import cn.dujc.superkid.bean.MessageEntity;


public class ReplyFragment extends BaseListFragment {
    List<MessageEntity> mList = new ArrayList<>();
    RecyclerView recyclerView;
    MessageEntityAdapter messageEntityAdapter;
    private final String TAG = ReplyFragment.class.getName();

    @Override
    public int getViewId() {
        return R.layout.fragment_reply;
    }

    @Override
    public void initBasic(Bundle savedInstanceState) {
        Bundle bundle = getArguments();
        if (bundle != null) {
            mList = bundle.getParcelableArrayList("list3");
        }
        initView();
    }

    public void setData(List<MessageEntity> mList) {
        if (messageEntityAdapter != null) {
            messageEntityAdapter.setDatas(mList);
        }
    }

    private void initView() {
        recyclerView = (RecyclerView) findViewById(R.id.test_recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        recyclerView.setNestedScrollingEnabled(false);
        messageEntityAdapter = new MessageEntityAdapter(0, mList);
        messageEntityAdapter.setContext(getActivity());
        recyclerView.setAdapter(messageEntityAdapter);
    }

    @Nullable
    @Override
    protected BaseQuickAdapter initAdapter() {
        return messageEntityAdapter;
    }

    @Override
    protected void onItemClick(int position) {

    }

    @Override
    protected void loadMore() {

    }

    @Override
    protected void reload() {

    }
}
